package com.zhouixi.reproduce.controller;

import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.CyclicBarrier;

import cn.hutool.http.HttpUtil;
import lombok.extern.slf4j.Slf4j;
@Slf4j
public class TestContrller {
	
	public static void main(String[] args) {
		
		
		
		Map idMap = new HashMap();
		CyclicBarrier cb = new CyclicBarrier(10);

		// 测试并发
		for (int i = 0; i < 10; i++) {
			Thread thread = new Thread(new Runnable() {
				@Override
				public void run() {
					try {
						cb.await();
					} catch (Exception e) {
						e.printStackTrace();
					}
					HttpUtil.get("http://localhost:8888/seckill");
					log.info("Thread：" + Thread.currentThread().getName() + " lock success");
				}
			});
			thread.start();
		}
	}
}
